var dokArray = document.assocs["rcc:sendAttachments"];
var person = document.assocs["rcc:sendRegistrator"][0];
var name = person.properties["{http://www.alfresco.org/model/content/1.0}firstName"];
var lname = person.properties["{http://www.alfresco.org/model/content/1.0}lastName"];
var registrator = name+" "+lname;
var dok = null;
if (dokArray!=null){
	for (var i=0;i<dokArray.length;i++){
		dok = document.assocs["rcc:sendAttachments"][i];
		if (dok.type!="{http://appdevel?.kada.lt/model/content/1.0}veiklosDokumentas") dok.specializeType("rcc:veiklosDokumentas");
		dok.properties["rcc:dokRegNum"] = document.properties["rcc:sendRegNumber"];
		dok.properties["rcc:dokRegDat"] = document.properties["rcc:sendRegDate"];
		dok.properties["rcc:grup"] = "Siun\u010diami";
		dok.properties["cm:title"] = document.properties["rcc:sendTitle"];
		dok.properties["rcc:dokRegAsmVarPav"] = registrator;
		dok.save();
	}
}